package com.gg.fmallspringboot.controller;

import com.gg.fmallspringboot.model.Result;
import com.gg.fmallspringboot.requestvo.OrderVo;
import com.gg.fmallspringboot.service.impl.OrderServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * 作者:Miki
 * 时间:2021/6/21 20:36
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderServiceImpl orderService;

    @PostMapping("/save")
    public Result saveOrder(@RequestBody OrderVo ov){
        Result result = orderService.saveOrder(ov.getCarIds(), ov.getUserId(), ov.getType(), ov.getAddrId());
        return result;
    }

    @RequestMapping("/update")
    public Result updateOrder(HttpServletRequest request){
        orderService.updateOrder(request);
        return null;
    }
}
